
package com.joolun.cloud.mall.api.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joolun.cloud.common.core.constant.CacheConstants;
import com.joolun.cloud.mall.api.mapper.ThemeMobileMapper;
import com.joolun.cloud.mall.api.service.ThemeMobileService;
import com.joolun.cloud.mall.common.entity.ThemeMobile;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * 移动端主题配置
 *
 * @author www.joolun.com
 * @date 2020-06-04 14:28:15
 */
@Service
public class ThemeMobileServiceImpl extends ServiceImpl<ThemeMobileMapper, ThemeMobile> implements ThemeMobileService {

	@Override
	@Cacheable(value = CacheConstants.MALL_THEME_MOBILE_CACHE, key = "#tenantId", unless = "#result == null")
	public ThemeMobile getByTenantId(Serializable tenantId) {
		return baseMapper.selectOne(Wrappers.emptyWrapper());
	}

}
